\(\int \cosh (a+b x^2) \, dx\) [4]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 8, antiderivative size = 53 \[ \int \cosh \left (a+b x^2\right ) \, dx=\frac {e^{-a} \sqrt {\pi } \text {erf}\left (\sqrt {b} x\right )}{4 \sqrt {b}}+\frac {e^a \sqrt {\pi } \text {erfi}\left (\sqrt {b} x\right )}{4 \sqrt {b}} \]

[Out]

1/4*erf(x*b^(1/2))*Pi^(1/2)/exp(a)/b^(1/2)+1/4*exp(a)*erfi(x*b^(1/2))*Pi^(1/2)/b^(1/2)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.375, Rules used = {5407, 2235, 2236} \[ \int \cosh \left (a+b x^2\right ) \, dx=\frac {\sqrt {\pi } e^{-a} \text {erf}\left (\sqrt {b} x\right )}{4 \sqrt {b}}+\frac {\sqrt {\pi } e^a \text {erfi}\left (\sqrt {b} x\right )}{4 \sqrt {b}} \]

[In]

Int[Cosh[a + b*x^2],x]

[Out]

(Sqrt[Pi]*Erf[Sqrt[b]*x])/(4*Sqrt[b]*E^a) + (E^a*Sqrt[Pi]*Erfi[Sqrt[b]*x])/(4*Sqrt[b])

Rule 2235

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[F^a*Sqrt[Pi]*(Erfi[(c + d*x)*Rt[b*Log[F], 2
]]/(2*d*Rt[b*Log[F], 2])), x] /; FreeQ[{F, a, b, c, d}, x] && PosQ[b]

Rule 2236

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[F^a*Sqrt[Pi]*(Erf[(c + d*x)*Rt[(-b)*Log[F],
 2]]/(2*d*Rt[(-b)*Log[F], 2])), x] /; FreeQ[{F, a, b, c, d}, x] && NegQ[b]

Rule 5407

Int[Cosh[(c_.) + (d_.)*(x_)^(n_)], x_Symbol] :> Dist[1/2, Int[E^(c + d*x^n), x], x] + Dist[1/2, Int[E^(-c - d*
x^n), x], x] /; FreeQ[{c, d}, x] && IGtQ[n, 1]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{2} \int e^{-a-b x^2} \, dx+\frac {1}{2} \int e^{a+b x^2} \, dx \\ & = \frac {e^{-a} \sqrt {\pi } \text {erf}\left (\sqrt {b} x\right )}{4 \sqrt {b}}+\frac {e^a \sqrt {\pi } \text {erfi}\left (\sqrt {b} x\right )}{4 \sqrt {b}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 45, normalized size of antiderivative = 0.85 \[ \int \cosh \left (a+b x^2\right ) \, dx=\frac {\sqrt {\pi } \left (\text {erf}\left (\sqrt {b} x\right ) (\cosh (a)-\sinh (a))+\text {erfi}\left (\sqrt {b} x\right ) (\cosh (a)+\sinh (a))\right )}{4 \sqrt {b}} \]

[In]

Integrate[Cosh[a + b*x^2],x]

[Out]

(Sqrt[Pi]*(Erf[Sqrt[b]*x]*(Cosh[a] - Sinh[a]) + Erfi[Sqrt[b]*x]*(Cosh[a] + Sinh[a])))/(4*Sqrt[b])

Maple [A] (verified)

Time = 0.03 (sec) , antiderivative size = 40, normalized size of antiderivative = 0.75

method result size
risch \(\frac {\operatorname {erf}\left (x \sqrt {b}\right ) \sqrt {\pi }\, {\mathrm e}^{-a}}{4 \sqrt {b}}+\frac {{\mathrm e}^{a} \sqrt {\pi }\, \operatorname {erf}\left (\sqrt {-b}\, x \right )}{4 \sqrt {-b}}\) \(40\)
meijerg \(\frac {\cosh \left (a \right ) \sqrt {\pi }\, \sqrt {2}\, \left (\frac {\sqrt {i b}\, \sqrt {2}\, \operatorname {erf}\left (x \sqrt {b}\right )}{2 \sqrt {b}}+\frac {\sqrt {i b}\, \sqrt {2}\, \operatorname {erfi}\left (x \sqrt {b}\right )}{2 \sqrt {b}}\right )}{4 \sqrt {i b}}-\frac {i \sinh \left (a \right ) \sqrt {\pi }\, \sqrt {2}\, \left (-\frac {\left (i b \right )^{\frac {3}{2}} \sqrt {2}\, \operatorname {erf}\left (x \sqrt {b}\right )}{2 b^{\frac {3}{2}}}+\frac {\left (i b \right )^{\frac {3}{2}} \sqrt {2}\, \operatorname {erfi}\left (x \sqrt {b}\right )}{2 b^{\frac {3}{2}}}\right )}{4 \sqrt {i b}}\) \(117\)

[In]

int(cosh(b*x^2+a),x,method=_RETURNVERBOSE)

[Out]

1/4*erf(x*b^(1/2))*Pi^(1/2)/exp(a)/b^(1/2)+1/4*exp(a)*Pi^(1/2)/(-b)^(1/2)*erf((-b)^(1/2)*x)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 49, normalized size of antiderivative = 0.92 \[ \int \cosh \left (a+b x^2\right ) \, dx=-\frac {\sqrt {\pi } \sqrt {-b} {\left (\cosh \left (a\right ) + \sinh \left (a\right )\right )} \operatorname {erf}\left (\sqrt {-b} x\right ) - \sqrt {\pi } \sqrt {b} {\left (\cosh \left (a\right ) - \sinh \left (a\right )\right )} \operatorname {erf}\left (\sqrt {b} x\right )}{4 \, b} \]

[In]

integrate(cosh(b*x^2+a),x, algorithm="fricas")

[Out]

-1/4*(sqrt(pi)*sqrt(-b)*(cosh(a) + sinh(a))*erf(sqrt(-b)*x) - sqrt(pi)*sqrt(b)*(cosh(a) - sinh(a))*erf(sqrt(b)
*x))/b

Sympy [F]

\[ \int \cosh \left (a+b x^2\right ) \, dx=\int \cosh {\left (a + b x^{2} \right )}\, dx \]

[In]

integrate(cosh(b*x**2+a),x)

[Out]

Integral(cosh(a + b*x**2), x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 87 vs. \(2 (35) = 70\).

Time = 0.20 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.64 \[ \int \cosh \left (a+b x^2\right ) \, dx=-\frac {1}{4} \, b {\left (\frac {2 \, x e^{\left (b x^{2} + a\right )}}{b} + \frac {2 \, x e^{\left (-b x^{2} - a\right )}}{b} - \frac {\sqrt {\pi } \operatorname {erf}\left (\sqrt {b} x\right ) e^{\left (-a\right )}}{b^{\frac {3}{2}}} - \frac {\sqrt {\pi } \operatorname {erf}\left (\sqrt {-b} x\right ) e^{a}}{\sqrt {-b} b}\right )} + x \cosh \left (b x^{2} + a\right ) \]

[In]

integrate(cosh(b*x^2+a),x, algorithm="maxima")

[Out]

-1/4*b*(2*x*e^(b*x^2 + a)/b + 2*x*e^(-b*x^2 - a)/b - sqrt(pi)*erf(sqrt(b)*x)*e^(-a)/b^(3/2) - sqrt(pi)*erf(sqr
t(-b)*x)*e^a/(sqrt(-b)*b)) + x*cosh(b*x^2 + a)

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 41, normalized size of antiderivative = 0.77 \[ \int \cosh \left (a+b x^2\right ) \, dx=-\frac {\sqrt {\pi } \operatorname {erf}\left (-\sqrt {b} x\right ) e^{\left (-a\right )}}{4 \, \sqrt {b}} - \frac {\sqrt {\pi } \operatorname {erf}\left (-\sqrt {-b} x\right ) e^{a}}{4 \, \sqrt {-b}} \]

[In]

integrate(cosh(b*x^2+a),x, algorithm="giac")

[Out]

-1/4*sqrt(pi)*erf(-sqrt(b)*x)*e^(-a)/sqrt(b) - 1/4*sqrt(pi)*erf(-sqrt(-b)*x)*e^a/sqrt(-b)

Mupad [F(-1)]

Timed out. \[ \int \cosh \left (a+b x^2\right ) \, dx=\int \mathrm {cosh}\left (b\,x^2+a\right ) \,d x \]

[In]

int(cosh(a + b*x^2),x)

[Out]

int(cosh(a + b*x^2), x)